home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 6 / coreaids.zip / MASM-FMT.DOC < prev    next >
Text File  |  1987-06-26  |  2KB  |  80 lines

  1.          Skeleton Format for MASM Main Programs
  2.  
  3. ;    DESC:    description of the program                           VX.XX
  4.  
  5.         where X.XX is the version number of the program
  6.  
  7. ;    IN:    *input parameter1 (one to a line)
  8. ;        *input parameter2
  9. ;        .................
  10. ;        *input parametern
  11. ;    OUT:    *output parameter1 (one to a line)
  12. ;        *output parameter2
  13. ;        ..................
  14. ;        *output parametern
  15. ;    SAMPLE:    Program name <input parameter1,ip2,...,ipn>,
  16. ;                     <output parameter1,op2,..,opn>
  17. ;    ####################################################################
  18.  
  19.  
  20. DSEG    Segment Para Public 'DATA'
  21.  
  22.         where DSEG is the program name with a 'D' appended to it.
  23.         and the last letter of the program name is dropped if it
  24.         is 8 characters.
  25.  
  26.         help block1 in the format of a call to TEXT_WRT (five words)
  27.         help block2 (segment address of licence block, one word)
  28.  
  29.         DW    0            ;help message.
  30.         DW    0
  31.         DD    MHELP
  32.         DW    EHELP
  33. MHELP        DB    'reiterate description as at top'
  34. EHELP        DB    0
  35.  
  36.         additional program data
  37.  
  38. DSEG    Ends
  39.  
  40.  
  41.         declaration of external procedures
  42.  
  43.  
  44.  
  45. CSEG    Segment Para Public 'CODE'
  46.  
  47.         where CSEG is the
  48.         code segment in the same format as the data segment except
  49.         with a 'C' in place as the 'D'.
  50.  
  51.     Assume CS:CSEG,DS:DESG
  52.  
  53.         macro calling program
  54.  
  55.     Include    CALLM.MAC            ;macro file which allows
  56.                         ;input and output of
  57.                         ;parameters to subroutines.
  58.         data area
  59.  
  60.     DW    0,0,0,180,0,0,0
  61.  
  62.         notice which must be 48 characters exactly and must be
  63.         directly before the main program.
  64.  
  65.     DB    'program name - V1.00, Copyright 1987, CoreTechs   ',0DH,0AH
  66.  
  67. program    Proc    Far            ;main procedure.
  68.  
  69.     where program is the name of the program
  70.  
  71.     Push    DS                ;store return address.
  72.     Xor    AX,AX
  73.     Push    AX
  74.  
  75.         main program body
  76.  
  77. program    Endp
  78. CSEG    Ends
  79.     End    program
  80.